package com.dingniu8;

class Constants {

	public static String url = "http://www.dingniu8.com/";
	
	public final static int BAD  = 2;
	public final static int GOOD  = 5;
	
	/**
	 * 在url中，有8个大表格
	 */
	public static int NUM_TABLE_GROUP = 8;

	/**
	 * 每个表格有4个子表，在tab中
	 */
	public static int NUM_TABLE_TAB = 4;

	/**
	 * 每个tab中有15个元素（前15名）
	 */
	public static int NUM_TABLE_CELL = 15;

	/**
	 * the pattern of table group. a table_group contains NUM_TABLE_TAB tables,
	 * each table is one pageline.
	 */
	public static String stock_table = ".*<table width='100%' class='table2 line' cellSpacing='0' cellPadding='0'><tr><td valign=top><table width='100%' border=0 valign=top><tr><td width='18%' align=center>排名</td><td align=center>股票名称</td>.*";
	public static String block_table = ".*<table width='100%' class='table2 line' cellSpacing='0' cellPadding='0'><tr><td valign=top><table width='100%' border=0 valign=top><tr><td width='18%' align=center>排名</td><td align=center>板块名称</td>.*";

	/**
	 * each table contains NUM_TABLE_CELL stock name or block name, such as 中国联通 or 基金重仓
	 */
	public static String stock_pattern = "<tr><td><B>\\d{1,}</b></td><td><A href='/stopview/searchTopview.asp\\?code=\\d{6}' target=_blank title='查看持仓数据'>.{1,10}</a></td><td align=right>.{1,10}</td></tr>";
	public static String block_pattern = "<tr><td><B>\\d{1,}</b></td><td><A href='/stopview/listShowBlocks.asp\\?blockcode=\\d{6}' target=_blank title='查看持仓数据'>.{1,10}</a></td><td align=right>.{1,10}</td></tr>";

	/**
	 * block/stock code is behind the block/stock_code_prefix
	 * the length is 6, fixed 
	 */
	public static String block_code_prefix = "/stopview/listShowBlocks.asp?blockcode=";
	public static String stock_code_prefix = "/stopview/searchTopview.asp?code=";

	/**
	 * the stock/block name resides in the middle of prefix and suffix
	 * the length is not fixed
	 */
	public static String name_prefix = "' target=_blank title='查看持仓数据'>";
	public static String name_suffix = "</a></td><td align=right>";

}
